/** When your routing table is too long, you can split it into small modules**/

import Layout from '@/layout'

const electronicRouter = {
  path: '/electronic',
  component: Layout,
  redirect: '/electronic/index',
  alwaysShow: true, // will always show the root menu
  name: 'Electronic',
  meta: {
    title: '元器件',
    icon: 'electronic',
    roles: ['admin', '研发', '库管']
  },
  children: [
    {
      path: 'index',
      name: 'Table',
      component: () => import('@/views/electronic/index'),
      meta: { title: '库存查询', icon: 'search' }
    },
    {
      path: 'research',
      name: 'Table',
      component: () => import('@/views/electronic/research/index'),
      meta: { title: '库存查询(研发)', icon: 'search', roles:['研发'] }
    },
    {
      path: 'stock',
      name: 'Table',
      component: () => import('@/views/electronic/stock/index'),
      meta: { title: '库存查询(库管)', icon: 'search', roles:['库管'] }
    },
    {
      path: 'add',
      name: 'Table',
      component: () => import('@/views/electronic/add'),
      meta: { title: '添加元器件', icon: 'plus' }
    },
    {
      path: 'modify',
      name: 'Table',
      component: () => import('@/views/electronic/modify'),
      meta: { title: '修改元器件', icon: 'edit' },
      hidden: true
    },
    {
      path: 'in_record',
      name: 'Table',
      component: () => import('@/views/electronic/in_record'),
      meta: { title: '入库记录查询', icon: 'table' }
    },
    {
      path: 'out_record',
      name: 'Tree',
      component: () => import('@/views/electronic/out_record'),
      meta: { title: '出库记录查询', icon: 'tree' }
    }
  ]
}

export default electronicRouter
